﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Petroleum.Tool;
using Petroleum.DB.Model;
using HZH_Controls.Controls;
using Petroleum.UC.Public;
using Petroleum.Model;

namespace Petroleum.UC
{
    public partial class Step8 : UserControl
    {
        FormMain main = new FormMain();
        List<Casing> casingList = Session.CasingProgram.CasingList;
        public Step8(FormMain main)
        {
            InitializeComponent();
            this.main = main;
            //最大值
            //txtDensity.InputText = Session.CasingProgram.CasingList;
            //var aa = 0;
            //foreach (var item in Session.CasingProgram.CasingList)
            //{
            //    aa < item.DepthRangeModelList.Max(m=>m.DepthRangeDensity);
            //}
        }
        //public Step8(PetroleumModel model)
        //{
        //    InitializeComponent();

        //}
        private void dgv_Load(object sender, EventArgs e)
        {
            List<DataGridViewColumnEntity> lstCulumns = new List<DataGridViewColumnEntity>();
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "SpudNo", HeadText = "SpudNo", Width = 150, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "BHANo", HeadText = "BHANo", Width = 150, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "BitSize", HeadText = "Bit Size (mm)", Width = 200, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "CasingSize", HeadText = "Casing size (mm)", Width = 200, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "InnerSpace", HeadText = "内空", Width = 150, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "EnvironmentalCapacity", HeadText = "理论环容", Width = 150, WidthType = SizeType.Absolute });
            lstCulumns.Add(new DataGridViewColumnEntity() { DataField = "SegmentLength", HeadText = "段长", Width = 150, WidthType = SizeType.Absolute });
            this.dgv.Columns = lstCulumns;
            this.dgv.DataSource = casingList;
        }
        private void btnDown_BtnClick(object sender, EventArgs e)
        {
            main.AddControl(new Step9BitTypesDesign(main));
        }
        private void btnUp_BtnClick(object sender, EventArgs e)
        {
            main.AddControl(new Step7(main));
        }
    }
}
